home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include <exec/types.h>
- #include <exec/nodes.h>
- #include <exec/lists.h>
- #include <exec/memory.h>
- #include <utility/tagitem.h>
- #include <powerup/ppclib/interface.h>
- #include <powerup/ppclib/message.h>
- #include <powerup/ppclib/tasks.h>
- #include <powerup/gcclib/powerup_protos.h>
-
- struct StartupData
- {
- ULONG MsgCount;
- };
-
- int main(void)
- {
- struct StartupData *StartupData;
- void *PPCPort;
- void *M68kMsg;
- ULONG MsgCount;
- ULONG i,j;
- ULONG *Body;
- ULONG w,le;
- UBYTE *b,*g;
-
- StartupData =(struct StartupData *) PPCGetTaskAttr(PPCTASKTAG_STARTUP_MSGDATA);
-
- MsgCount = StartupData->MsgCount;
-
- if (PPCPort=(void*) PPCGetTaskAttr(PPCTASKTAG_MSGPORT))
- {
- for (i=0;i<MsgCount;i++)
- {
- PPCWaitPort(PPCPort);
-
- if (M68kMsg = PPCGetMessage(PPCPort))
- {
- Body = (ULONG *)PPCGetMessageAttr(M68kMsg, PPCMSGTAG_DATA);
- g = (UBYTE *)Body[0];
- b = (UBYTE *)Body[1];
- w = Body[2];
- le = Body[3];
-
- for(j=0;j<w;j++)
- {
- g[j+le] = ((int)g[j+le] * 215) >> 8;
- b[j+le] = ((int)b[j+le] * 174) >> 8;
- }
- PPCReplyMessage(M68kMsg);
- }
- }
- }
- }
-